#include<vector>
using namespace std;
bool IsPopOrder(vector<int>& pushV, vector<int>& popV) {
    // write code here
    vector<int> vec;
    int i = 0;
    int len = pushV.size();
    int y = 0;
    while (i < len) {
        vec.push_back(pushV[i]);
        i++;
        while (y < popV.size() && !vec.empty() && vec.back() == popV[y]) {
            vec.pop_back();
            y++;
        }
    }
    return vec.size() == 0;
}
int main()
{
    vector<int> pushV;
    vector<int> popV;
    pushV.push_back(1);
    popV.push_back(1);
    IsPopOrder(pushV, popV);
    return 0;
}